home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / nos042_s / filter.h < prev    next >
C/C++ Source or Header  |  1994-09-16  |  2KB  |  46 lines

  1. /****************************************************************************
  2. *    $Id: filter.h 1.2 93/07/16 11:44:39 ROOT_DOS Exp $
  3. *    14 Jun 93    1.2        GT    Enable ip_filter () prototype.                    *
  4. *
  5. *  ATARI Version by David Nash - dnash@chaos.demon.co.uk
  6. *
  7. *  hide definition of struct ip with  incomplete definition
  8. *
  9. ****************************************************************************/
  10. #ifndef _FILTER_H
  11. #define _FILTER_H
  12.  
  13. #ifndef _GLOBAL_H
  14. #include "global.h"
  15. #endif
  16.  
  17. #define FILTER_ACTION_DENY 1
  18. #define FILTER_ACTION_PERMIT 2
  19.  
  20. #ifdef ATARI
  21. struct ip;        /* hide definition of struct ip - defined in ip.h */
  22. #endif
  23.  
  24. /*
  25.  *   Filter entry structure.
  26.  */
  27. struct filter {
  28.     struct filter    *next;        /* Link to next filter element    */
  29.     short        action;        /* Filter entry match action    */
  30.     int        (*type) __ARGS((struct mbuf *bp, struct ip *ip, struct filter *fp));    /* Packet type comparison f(x)    */
  31.     struct filtersd {
  32.           unsigned long addr;    /* Address used for comparisons    */
  33.         unsigned long mask;    /* Address comparison mask    */
  34.         unsigned char bits;    /* One bits in high part of mask*/
  35.         unsigned char exclude;    /* Exclude matching addresses    */
  36.         unsigned short port;    /* TCP/UDP port (low of range)    */
  37.         unsigned short hiport;    /* High port of range        */
  38.     } src, dest;
  39.     unsigned long    matches;    /* Number of matching packets    */
  40. };
  41.  
  42. int doipfilter __ARGS(( int argc, char *argv[], void *p ));
  43. int ip_filter __ARGS(( struct mbuf *bp, struct ip *ip, struct filter *fp ));
  44.  
  45. #endif /* _FILTER_H */
  46.